import 'package:flutter/animation.dart';
import 'package:get/get.dart';

import 'state.dart';

class LoginLogic extends GetxController with GetSingleTickerProviderStateMixin {
  final LoginState state = LoginState();

  late AnimationController animationController;

  bool hasPhone() {
    return state.phone.length == 11;
  }

  bool hasPhoneAndCode() {
    return hasPhone() && state.code.length == 6;
  }

  @override
  void onInit() {
    super.onInit();

    animationController = AnimationController(
        duration: Duration(milliseconds: 1500), vsync: this);
    animationController.forward();
  }
}
